package com.hschinese.pronunciation.utils;

import java.text.NumberFormat;

/**
 * Created by zf on 2018/1/24.
 */

public class NumberFormatUtil {

    public static String getPercent(int posstion,int total){
        NumberFormat numberFormat = NumberFormat.getInstance();
        // 设置精确到小数点后2位
        numberFormat.setMaximumFractionDigits(0);
        String result = numberFormat.format((float) (posstion+1)/ (float) total * 100);
        return result;
    }

}
